#ifndef _CACHEMAP_H_
#define _CACHEMAP_H_
#include <QMap>
#include <QString>

struct Cache
{
    QString filePath;
    QString md5;
    QString name;
};

class CacheMap
{
public:
    CacheMap();
    bool isCached(const QFileInfo& name);
    void addToCache(const QFileInfo& name);

    QString getCachedFile(const QFileInfo& name);
    bool contains(const QString& name);
    QString findCachedByModuleName(const QString& modName);
private:
    void loadCache();
    QString md5(const QString& fileName);
    QMap<QString, Cache> _map;
};

#endif
